﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommonNet48.CommonModel
{
    /// <summary>
    /// 我的信息类型
    /// </summary>
    public enum MyMsgType
    {
        [Display(Name = "调试")]
        Debug = 0,
        [Display(Name = "提示")]
        Info = 1,
        [Display(Name = "警告")]
        Warn = 2,
        [Display(Name = "错误")]
        Error = 3,
        [Display(Name = "自定义1")]
        Custom1 = 4,
        [Display(Name = "自定义2")]
        Custom2 = 5,
        [Display(Name = "自定义3")]
        Custom3 = 6,
    }

    /// <summary>
    /// 我的信息实体
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class MyMessage<T>
    {
        public T Message { get; set; }

        public MyMsgType MsgType { get; set; }

        public object[] OtherProp { get; set; }

        public MyMessage() { }

        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="msg">消息内容对象</param>
        /// <param name="type">消息类型</param>
        public MyMessage(T msg, MyMsgType type)
        {
            this.Message = msg;
            this.MsgType = type;

        }
    }
}
